I am taking data from an html table and posting it back to python so I can process user changes. I get the data packaged and sent to Python and it looks like the below (just a flash of the variable). Each record should really be a row with 9 elements so the first row should start at the beginning of the line and end at the 1 just before "test1". "test1" should start the next line and so on. Not sure if I am not formatting it correctly in the HTML or if I am missing something in Python. Any guidance is appreciated. Code below: wo name5 | Sticky_Tape_Catch_Behind_R-97.mp4 | cat1 | subcat1 | 200 | 0 | 1 | 0 | 1 test1 | https://youtu.be/P-61-sgSN3w | testcat1 | testsubcat1 | 20 | 0 | 1 | 0 | 0 egsegege | Outside_Pull_Outside_Pull-59.mp4 | fgsedsefgs | segsegse | 1 | 0 | 1 | 0 | 0 pdf | HTML-Cheat-Sheet_1.pdf | pdf cat | pdf sub cat | 20 | 0 | 1 | 0 | 0 pdf | HTML-Cheat-Sheet_2.pdf | pdf cat | pdf sub cat | 20 | 0 | 1 | 0 | 0 HTML <pre class='prettyprint lang-py'> function tablePass() { var html_table_data = ""; var bRowStarted = true; $('#woTable tbody>tr').each(function () { $('td', this).each(function () { if (html_table_data.length == 0 || bRowStarted == true) { html_table_data += $(this).text(); bRowStarted = false; } else html_table_data += " | " + $(this).text(); }); html_table_data += "n"; bRowStarted = true; }); alert(html_table_data); // var plantabledata = JSON.stringify(TableData);